package cn.zqh.user.controller;


import cn.zqh.bean.api.CommonResult;
import cn.zqh.user.service.UserPermissionConnectService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author zqh
 * @since 2022-12-24
 */
@RestController
@RequestMapping("permission")

public class UserPermissionConnectController {

    @Autowired
    private UserPermissionConnectService userPermissionConnectService;
    
    /**
      * @Author: zqh
      * @Date: 
      * @Description: 权限赋予
    */
    @ApiOperation(value = "权限赋予1管理员，2普通用户，3店主")
    @PostMapping("permissionGranting")
    public CommonResult permissionGranting(String userId,Integer permissionId){
        return userPermissionConnectService.permissionGranting(userId,permissionId);
    }

    /**
      * @Author: zqh
      * @Date:
      * @Description: 权限回收
    */
    @ApiOperation(value = "权限回收")
    @PostMapping("rightsRecycling")
    public CommonResult rightsRecycling(String userId,Integer permissionId){
        return userPermissionConnectService.rightsRecycling(userId,permissionId);
    }


}

